-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds InvalidRegex TaintConfiguration Error type #743
Conversation
Footnotes:
|
Hey @abishekvashok, I'm sorry, this PR slipped by me and I just noticed. Let me forward it to the Pysa team for you. |
@connernilsen thank you. There's also #739 and #741 if you don't mind 😁 Also do take your time :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
let json_string_member_with_location ~path key value = | ||
json_exception_to_error ~path ~section:key (fun () -> | ||
let node = JsonAst.Json.Util.member_exn key value in | ||
let value = JsonAst.Json.Util.to_string_exn node in | ||
let location = JsonAst.Json.Util.to_location_exn node in | ||
Result.return (value, location)) | ||
in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like #741 also adds this, so we will need to be careful when merging this.
EDIT: Just noticed this was already mentioned above..
@arthaud has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Adds new error type that can handle Re2 compilation failed exceptions. Previously, when a regex compilation failed, the exception wasn't caught and the program terminated abnormally. Catch the exception, and throw a custom TaintConfiguration Error to expose the underlying reason why the compilation failed and exit in a more user-friendly fashion. Signed-off-by: Abishek V Ashok <abishekvashok@gmail.com>
8299374
to
f2703e3
Compare
@arthaud rebased on top of main :) You may want to re-import. |
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit install
pre-commit run
Summary
Adds new error type that can handle Re2 compilation failed exceptions. Previously, when a regex compilation failed, the exception wasn't caught and the program terminated abnormally.
Catch the exception, and throw a custom TaintConfiguration Error to expose the underlying reason why the compilation failed and exit in a more user-friendly fashion.
Test Plan
Before:
After:
Fixes part of: MLH-Fellowship#82
Signed-off-by: Abishek V Ashok abishekvashok@gmail.com
make test